Imports System.Data
Imports System.Xml
Imports System.Data.SqlClient


Public Class frmAPStatement
    Inherits System.Windows.Forms.Form
    Dim BFQty As Double = 0
    Dim util As New AppsUtility.EncDec
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents cmbCustomer As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmbCompany As DevComponents.DotNetBar.Controls.ComboBoxEx
    Friend WithEvents cmdPrint As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdRefresh As DevComponents.DotNetBar.ButtonX
    Friend WithEvents cmdExit As DevComponents.DotNetBar.ButtonX
    Friend WithEvents GroupPanel1 As DevComponents.DotNetBar.Controls.GroupPanel
    Public strCon As String = util.toDecrypt(System.Configuration.ConfigurationSettings.AppSettings("SQLString"))

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents dtpFromDate As System.Windows.Forms.DateTimePicker
    Friend WithEvents dtpToDate As System.Windows.Forms.DateTimePicker
    Friend WithEvents dgTrxEnq As System.Windows.Forms.DataGrid
    Friend WithEvents tbOpbal As System.Windows.Forms.TextBox
    Friend WithEvents tbTotalDr As System.Windows.Forms.TextBox
    Friend WithEvents tbTotalCr As System.Windows.Forms.TextBox
    Friend WithEvents tbClBal As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents tbAge1 As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents tbAge2 As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents tbAge3 As System.Windows.Forms.TextBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents tbAge4 As System.Windows.Forms.TextBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents tbCusCode As System.Windows.Forms.TextBox
    Friend WithEvents aPstatementRpt1 As APstatementRpt

    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.Label8 = New System.Windows.Forms.Label()
        Me.tbOpbal = New System.Windows.Forms.TextBox()
        Me.tbTotalDr = New System.Windows.Forms.TextBox()
        Me.Label9 = New System.Windows.Forms.Label()
        Me.tbTotalCr = New System.Windows.Forms.TextBox()
        Me.tbClBal = New System.Windows.Forms.TextBox()
        Me.Label10 = New System.Windows.Forms.Label()
        Me.dtpFromDate = New System.Windows.Forms.DateTimePicker()
        Me.dtpToDate = New System.Windows.Forms.DateTimePicker()
        Me.dgTrxEnq = New System.Windows.Forms.DataGrid()
        Me.tbAge1 = New System.Windows.Forms.TextBox()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.tbAge2 = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.tbAge3 = New System.Windows.Forms.TextBox()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.tbAge4 = New System.Windows.Forms.TextBox()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.tbCusCode = New System.Windows.Forms.TextBox()
        Me.aPstatementRpt1 = New APstatementRpt()
        Me.Label11 = New System.Windows.Forms.Label()
        Me.cmbCustomer = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmbCompany = New DevComponents.DotNetBar.Controls.ComboBoxEx()
        Me.cmdPrint = New DevComponents.DotNetBar.ButtonX()
        Me.cmdRefresh = New DevComponents.DotNetBar.ButtonX()
        Me.cmdExit = New DevComponents.DotNetBar.ButtonX()
        Me.GroupPanel1 = New DevComponents.DotNetBar.Controls.GroupPanel()
        CType(Me.dgTrxEnq, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.GroupPanel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Label2
        '
        Me.Label2.AutoSize = True
        Me.Label2.BackColor = System.Drawing.Color.Transparent
        Me.Label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label2.Location = New System.Drawing.Point(434, 21)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(54, 18)
        Me.Label2.TabIndex = 53
        Me.Label2.Text = "To Date"
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.BackColor = System.Drawing.Color.Transparent
        Me.Label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label1.Location = New System.Drawing.Point(322, 21)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(72, 18)
        Me.Label1.TabIndex = 51
        Me.Label1.Text = "From Date"
        '
        'Label8
        '
        Me.Label8.AutoSize = True
        Me.Label8.BackColor = System.Drawing.Color.Transparent
        Me.Label8.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label8.Location = New System.Drawing.Point(886, 24)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(88, 18)
        Me.Label8.TabIndex = 81
        Me.Label8.Text = "Opg .Balance"
        '
        'tbOpbal
        '
        Me.tbOpbal.BackColor = System.Drawing.Color.White
        Me.tbOpbal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbOpbal.Location = New System.Drawing.Point(895, 69)
        Me.tbOpbal.Name = "tbOpbal"
        Me.tbOpbal.ReadOnly = True
        Me.tbOpbal.Size = New System.Drawing.Size(122, 26)
        Me.tbOpbal.TabIndex = 82
        Me.tbOpbal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'tbTotalDr
        '
        Me.tbTotalDr.BackColor = System.Drawing.Color.White
        Me.tbTotalDr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbTotalDr.Location = New System.Drawing.Point(771, 391)
        Me.tbTotalDr.Name = "tbTotalDr"
        Me.tbTotalDr.ReadOnly = True
        Me.tbTotalDr.Size = New System.Drawing.Size(121, 26)
        Me.tbTotalDr.TabIndex = 84
        Me.tbTotalDr.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label9
        '
        Me.Label9.AutoSize = True
        Me.Label9.BackColor = System.Drawing.Color.Transparent
        Me.Label9.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label9.Location = New System.Drawing.Point(723, 370)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(38, 18)
        Me.Label9.TabIndex = 83
        Me.Label9.Text = "Total"
        '
        'tbTotalCr
        '
        Me.tbTotalCr.BackColor = System.Drawing.Color.White
        Me.tbTotalCr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbTotalCr.Location = New System.Drawing.Point(896, 390)
        Me.tbTotalCr.Name = "tbTotalCr"
        Me.tbTotalCr.ReadOnly = True
        Me.tbTotalCr.Size = New System.Drawing.Size(121, 26)
        Me.tbTotalCr.TabIndex = 85
        Me.tbTotalCr.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'tbClBal
        '
        Me.tbClBal.BackColor = System.Drawing.Color.White
        Me.tbClBal.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbClBal.Location = New System.Drawing.Point(896, 421)
        Me.tbClBal.Name = "tbClBal"
        Me.tbClBal.ReadOnly = True
        Me.tbClBal.Size = New System.Drawing.Size(121, 26)
        Me.tbClBal.TabIndex = 87
        Me.tbClBal.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label10
        '
        Me.Label10.AutoSize = True
        Me.Label10.BackColor = System.Drawing.Color.Transparent
        Me.Label10.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label10.Location = New System.Drawing.Point(806, 398)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(82, 18)
        Me.Label10.TabIndex = 86
        Me.Label10.Text = "Clg. Balance"
        '
        'dtpFromDate
        '
        Me.dtpFromDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpFromDate.Location = New System.Drawing.Point(329, 66)
        Me.dtpFromDate.Name = "dtpFromDate"
        Me.dtpFromDate.Size = New System.Drawing.Size(105, 26)
        Me.dtpFromDate.TabIndex = 153
        '
        'dtpToDate
        '
        Me.dtpToDate.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
        Me.dtpToDate.Location = New System.Drawing.Point(441, 66)
        Me.dtpToDate.Name = "dtpToDate"
        Me.dtpToDate.Size = New System.Drawing.Size(112, 26)
        Me.dtpToDate.TabIndex = 154
        '
        'dgTrxEnq
        '
        Me.dgTrxEnq.BackColor = System.Drawing.Color.AliceBlue
        Me.dgTrxEnq.BackgroundColor = System.Drawing.Color.AliceBlue
        Me.dgTrxEnq.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.dgTrxEnq.CaptionVisible = False
        Me.dgTrxEnq.DataMember = ""
        Me.dgTrxEnq.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgTrxEnq.Location = New System.Drawing.Point(13, 101)
        Me.dgTrxEnq.Name = "dgTrxEnq"
        Me.dgTrxEnq.PreferredColumnWidth = 175
        Me.dgTrxEnq.ReadOnly = True
        Me.dgTrxEnq.Size = New System.Drawing.Size(1004, 276)
        Me.dgTrxEnq.TabIndex = 155
        Me.dgTrxEnq.TabStop = False
        '
        'tbAge1
        '
        Me.tbAge1.BackColor = System.Drawing.Color.White
        Me.tbAge1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAge1.Location = New System.Drawing.Point(14, 419)
        Me.tbAge1.Name = "tbAge1"
        Me.tbAge1.ReadOnly = True
        Me.tbAge1.Size = New System.Drawing.Size(121, 26)
        Me.tbAge1.TabIndex = 156
        Me.tbAge1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label3
        '
        Me.Label3.AutoSize = True
        Me.Label3.BackColor = System.Drawing.Color.Transparent
        Me.Label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label3.Location = New System.Drawing.Point(8, 375)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(55, 18)
        Me.Label3.TabIndex = 157
        Me.Label3.Text = "Current"
        '
        'Label4
        '
        Me.Label4.AutoSize = True
        Me.Label4.BackColor = System.Drawing.Color.Transparent
        Me.Label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label4.Location = New System.Drawing.Point(133, 374)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(86, 18)
        Me.Label4.TabIndex = 159
        Me.Label4.Text = "Over 30 days"
        '
        'tbAge2
        '
        Me.tbAge2.BackColor = System.Drawing.Color.White
        Me.tbAge2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAge2.Location = New System.Drawing.Point(141, 419)
        Me.tbAge2.Name = "tbAge2"
        Me.tbAge2.ReadOnly = True
        Me.tbAge2.Size = New System.Drawing.Size(121, 26)
        Me.tbAge2.TabIndex = 158
        Me.tbAge2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label5
        '
        Me.Label5.AutoSize = True
        Me.Label5.BackColor = System.Drawing.Color.Transparent
        Me.Label5.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label5.Location = New System.Drawing.Point(264, 374)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(86, 18)
        Me.Label5.TabIndex = 161
        Me.Label5.Text = "Over 60 days"
        '
        'tbAge3
        '
        Me.tbAge3.BackColor = System.Drawing.Color.White
        Me.tbAge3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAge3.Location = New System.Drawing.Point(270, 419)
        Me.tbAge3.Name = "tbAge3"
        Me.tbAge3.ReadOnly = True
        Me.tbAge3.Size = New System.Drawing.Size(121, 26)
        Me.tbAge3.TabIndex = 160
        Me.tbAge3.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label6
        '
        Me.Label6.AutoSize = True
        Me.Label6.BackColor = System.Drawing.Color.Transparent
        Me.Label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label6.Location = New System.Drawing.Point(390, 374)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(86, 18)
        Me.Label6.TabIndex = 163
        Me.Label6.Text = "Over 90 days"
        '
        'tbAge4
        '
        Me.tbAge4.BackColor = System.Drawing.Color.White
        Me.tbAge4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbAge4.Location = New System.Drawing.Point(397, 419)
        Me.tbAge4.Name = "tbAge4"
        Me.tbAge4.ReadOnly = True
        Me.tbAge4.Size = New System.Drawing.Size(121, 26)
        Me.tbAge4.TabIndex = 162
        Me.tbAge4.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        '
        'Label7
        '
        Me.Label7.AutoSize = True
        Me.Label7.BackColor = System.Drawing.Color.Transparent
        Me.Label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label7.Location = New System.Drawing.Point(8, 20)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(88, 18)
        Me.Label7.TabIndex = 165
        Me.Label7.Text = "Supplier Info"
        '
        'tbCusCode
        '
        Me.tbCusCode.BackColor = System.Drawing.Color.White
        Me.tbCusCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.tbCusCode.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper
        Me.tbCusCode.Location = New System.Drawing.Point(211, 37)
        Me.tbCusCode.MaxLength = 6
        Me.tbCusCode.Name = "tbCusCode"
        Me.tbCusCode.Size = New System.Drawing.Size(111, 26)
        Me.tbCusCode.TabIndex = 164
        '
        'Label11
        '
        Me.Label11.AutoSize = True
        Me.Label11.BackColor = System.Drawing.Color.Transparent
        Me.Label11.ForeColor = System.Drawing.SystemColors.ActiveCaptionText
        Me.Label11.Location = New System.Drawing.Point(553, 21)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(66, 18)
        Me.Label11.TabIndex = 53
        Me.Label11.Text = "Company"
        '
        'cmbCustomer
        '
        Me.cmbCustomer.DisplayMember = "Text"
        Me.cmbCustomer.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbCustomer.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbCustomer.ItemHeight = 19
        Me.cmbCustomer.Location = New System.Drawing.Point(14, 66)
        Me.cmbCustomer.Name = "cmbCustomer"
        Me.cmbCustomer.Size = New System.Drawing.Size(308, 25)
        Me.cmbCustomer.TabIndex = 166
        '
        'cmbCompany
        '
        Me.cmbCompany.DisplayMember = "Text"
        Me.cmbCompany.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed
        Me.cmbCompany.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cmbCompany.ItemHeight = 19
        Me.cmbCompany.Location = New System.Drawing.Point(559, 65)
        Me.cmbCompany.Name = "cmbCompany"
        Me.cmbCompany.Size = New System.Drawing.Size(234, 25)
        Me.cmbCompany.TabIndex = 166
        '
        'cmdPrint
        '
        Me.cmdPrint.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdPrint.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdPrint.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdPrint.Location = New System.Drawing.Point(760, 470)
        Me.cmdPrint.Name = "cmdPrint"
        Me.cmdPrint.Size = New System.Drawing.Size(82, 27)
        Me.cmdPrint.TabIndex = 261
        Me.cmdPrint.Text = "Print"
        '
        'cmdRefresh
        '
        Me.cmdRefresh.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdRefresh.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdRefresh.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdRefresh.Location = New System.Drawing.Point(848, 470)
        Me.cmdRefresh.Name = "cmdRefresh"
        Me.cmdRefresh.Size = New System.Drawing.Size(82, 27)
        Me.cmdRefresh.TabIndex = 262
        Me.cmdRefresh.Text = "Refresh"
        '
        'cmdExit
        '
        Me.cmdExit.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton
        Me.cmdExit.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmdExit.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(0, Byte), Integer), CType(CType(64, Byte), Integer))
        Me.cmdExit.Location = New System.Drawing.Point(935, 470)
        Me.cmdExit.Name = "cmdExit"
        Me.cmdExit.Size = New System.Drawing.Size(82, 27)
        Me.cmdExit.TabIndex = 260
        Me.cmdExit.Text = "Exit"
        '
        'GroupPanel1
        '
        Me.GroupPanel1.CanvasColor = System.Drawing.SystemColors.Control
        Me.GroupPanel1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007
        Me.GroupPanel1.Controls.Add(Me.Label11)
        Me.GroupPanel1.Controls.Add(Me.Label1)
        Me.GroupPanel1.Controls.Add(Me.Label2)
        Me.GroupPanel1.Controls.Add(Me.Label8)
        Me.GroupPanel1.Controls.Add(Me.Label9)
        Me.GroupPanel1.Controls.Add(Me.Label10)
        Me.GroupPanel1.Controls.Add(Me.Label3)
        Me.GroupPanel1.Controls.Add(Me.Label4)
        Me.GroupPanel1.Controls.Add(Me.Label5)
        Me.GroupPanel1.Controls.Add(Me.Label6)
        Me.GroupPanel1.Controls.Add(Me.Label7)
        Me.GroupPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.GroupPanel1.Location = New System.Drawing.Point(0, 0)
        Me.GroupPanel1.Name = "GroupPanel1"
        Me.GroupPanel1.Size = New System.Drawing.Size(1034, 509)
        '
        '
        '
        Me.GroupPanel1.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2
        Me.GroupPanel1.Style.BackColorGradientAngle = 90
        Me.GroupPanel1.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground
        Me.GroupPanel1.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderBottomWidth = 1
        Me.GroupPanel1.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder
        Me.GroupPanel1.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderLeftWidth = 1
        Me.GroupPanel1.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderRightWidth = 1
        Me.GroupPanel1.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid
        Me.GroupPanel1.Style.BorderTopWidth = 1
        Me.GroupPanel1.Style.CornerDiameter = 4
        Me.GroupPanel1.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded
        Me.GroupPanel1.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center
        Me.GroupPanel1.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText
        Me.GroupPanel1.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near
        Me.GroupPanel1.TabIndex = 263
        Me.GroupPanel1.Text = "AP Statement"
        '
        'APstatement
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.SystemColors.ActiveCaption
        Me.ClientSize = New System.Drawing.Size(1034, 509)
        Me.ControlBox = False
        Me.Controls.Add(Me.cmdPrint)
        Me.Controls.Add(Me.cmdRefresh)
        Me.Controls.Add(Me.cmdExit)
        Me.Controls.Add(Me.cmbCompany)
        Me.Controls.Add(Me.cmbCustomer)
        Me.Controls.Add(Me.tbAge4)
        Me.Controls.Add(Me.tbAge3)
        Me.Controls.Add(Me.tbAge2)
        Me.Controls.Add(Me.tbAge1)
        Me.Controls.Add(Me.tbOpbal)
        Me.Controls.Add(Me.tbCusCode)
        Me.Controls.Add(Me.dgTrxEnq)
        Me.Controls.Add(Me.dtpToDate)
        Me.Controls.Add(Me.dtpFromDate)
        Me.Controls.Add(Me.tbClBal)
        Me.Controls.Add(Me.tbTotalCr)
        Me.Controls.Add(Me.tbTotalDr)
        Me.Controls.Add(Me.GroupPanel1)
        Me.Font = New System.Drawing.Font("Calibri", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.SystemColors.ControlLightLight
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Location = New System.Drawing.Point(50, 70)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "APstatement"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        CType(Me.dgTrxEnq, System.ComponentModel.ISupportInitialize).EndInit()
        Me.GroupPanel1.ResumeLayout(False)
        Me.GroupPanel1.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region
    Private Sub Budgets_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim APdata As New APdataLogic
        Dim ds, ds2 As DataSet
        ds = APdata.GetAllCompany()
        cmbCompany.DataSource = ds.Tables(0)
        cmbCompany.ValueMember = "CompanyID"
        cmbCompany.DisplayMember = "CompanyName"
        cmbCompany.SelectedValue = CompanyID
        ds2 = APdata.GetCompanySuppliers(CompanyID)
        cmbCustomer.DataSource = ds2.Tables(0)
        cmbCustomer.ValueMember = "SupID"
        cmbCustomer.DisplayMember = "SupName"
        'Customer_load()
        'dgTrxEnq_load()
    End Sub
    Private Sub dgTrxEnq_load()
        Try
            Dim FrDt, ToDt As String
            FrDt = dtpFromDate.Text
            ToDt = dtpToDate.Text
            FrDt = FrDt.Substring(6, 4) & "-" & FrDt.Substring(3, 2) & "-" & FrDt.Substring(0, 2)
            ToDt = ToDt.Substring(6, 4) & "-" & ToDt.Substring(3, 2) & "-" & ToDt.Substring(0, 2)
            Dim strsql As String
            Dim sqlCon As SqlConnection = New SqlConnection(strCon)
            sqlCon.Open()
            strsql = "select DocNum,DocDate,DocType,DocAmt DrAmount,null CrAmount,DocFcAmt,DocFcCode,DocRefer,TrxNumber from APTRX where SupID=" & cmbCustomer.SelectedValue & " and " & _
            "(DocDate between '" & FrDt & "' and '" & ToDt & "') " & _
            "and DocAmt>0 " & _
            "UNION ALL " & _
            "select DocNum,DocDate,DocType,null DrAmount,abs(DocAmt) CrAmount,DocFcAmt,DocFcCode,DocRefer,TrxNumber from APTRX where SupID=" & cmbCustomer.SelectedValue & " and " & _
            "(DocDate between '" & FrDt & "' and '" & ToDt & "') " & _
            "and DocAmt<0 " & _
            " order by DocDate "
            Dim da As New SqlClient.SqlDataAdapter(strsql, sqlCon)
            Dim ds As New DataSet("TRENQ")
            da.Fill(ds, "TRENQ")
            '23/09/2009
            Dim drow As DataRow
            Dim DrTot, CrTot As Decimal
            For Each drow In ds.Tables(0).Rows
                If Not IsDBNull(drow("DrAmount")) Then
                    DrTot += Decimal.Parse(drow("DrAmount"))
                End If
                If Not IsDBNull(drow("CrAmount")) Then
                    CrTot += Decimal.Parse(drow("CrAmount"))
                End If
            Next
            tbTotalDr.Text = DrTot.ToString("#0.000")
            tbTotalCr.Text = CrTot.ToString("#0.000")
            '23/09/2009
            dgTrxEnq.DataSource = ds
            dgTrxEnq.DataMember = "TRENQ"
            dgTrxEnq.ReadOnly = True
            dgTrxEnq.TableStyles.Clear()
            dgTrxEnq_Style()
            sqlCon.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Sub

    Private Sub dgTrxEnq_Style()
        With dgTrxEnq
            .TableStyles.Clear()
            .CaptionBackColor = System.Drawing.Color.SlateBlue
            .CaptionForeColor = System.Drawing.Color.LemonChiffon
            .AllowSorting = True
            .AlternatingBackColor = System.Drawing.Color.AliceBlue
            .ParentRowsBackColor = System.Drawing.Color.Lavender
            .ParentRowsForeColor = System.Drawing.Color.SlateBlue
            .HeaderBackColor = System.Drawing.Color.LemonChiffon
            .AllowNavigation = False
            .ParentRowsVisible = False
            .RowHeadersVisible = False
        End With

        Dim grdTableStyle As New DataGridTableStyle
        With grdTableStyle
            .AlternatingBackColor = Color.AliceBlue
            .HeaderFont = New Font("Tahoma", 8.0!, FontStyle.Bold)
            .MappingName = "TRENQ"
            .PreferredColumnWidth = 160
            .HeaderBackColor = Color.LightSlateGray
            .HeaderForeColor = Color.LightCyan
            .PreferredRowHeight = 15
            .RowHeadersVisible = False
            .RowHeaderWidth = 0
        End With



        Dim cs As DataGridColumnStyle
        cs = New DataGridTextBoxColumn
        cs.Width = 95
        cs.MappingName = "DocDate"
        cs.HeaderText = "Date"
        cs.NullText = ""
        grdTableStyle.GridColumnStyles.Add(cs)

        Dim cs1 As DataGridColumnStyle
        cs1 = New DataGridTextBoxColumn
        cs1.Width = 85
        cs1.MappingName = "DocNum"
        cs1.HeaderText = "Doc.No."
        cs1.NullText = ""
        grdTableStyle.GridColumnStyles.Add(cs1)

        Dim cs5 As DataGridColumnStyle
        cs5 = New DataGridTextBoxColumn
        cs5.Width = 90
        cs5.MappingName = "DocType"
        cs5.HeaderText = "Type"
        cs5.NullText = ""
        grdTableStyle.GridColumnStyles.Add(cs5)


        Dim cs2 As DataGridColumnStyle
        cs2 = New DataGridTextBoxColumn  ' Add the standard column style.
        cs2.Width = 280
        cs2.MappingName = "DocRefer"
        cs2.HeaderText = "Description"
        cs2.NullText = ""
        cs2.ReadOnly = True
        grdTableStyle.GridColumnStyles.Add(cs2)

        Dim cs0 As DataGridColumnStyle
        cs0 = New DataGridTextBoxColumn  ' Add the standard column style.
        cs0.Width = 105
        cs0.MappingName = "DrAmount"
        cs0.HeaderText = "Debit KD"
        cs0.NullText = ""
        cs0.ReadOnly = True
        cs0.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs0)

        Dim cs4 As DataGridColumnStyle
        cs4 = New DataGridTextBoxColumn  ' Add the standard column style.
        cs4.Width = 115
        cs4.MappingName = "CrAmount"
        cs4.HeaderText = "Credit KD"
        cs4.NullText = ""
        cs4.ReadOnly = True
        cs4.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs4)

        Dim cs6 As DataGridColumnStyle
        cs6 = New DataGridTextBoxColumn  ' Add the standard column style.
        cs6.Width = 115
        cs6.MappingName = "DocFcAmt"
        cs6.HeaderText = "Amount FC"
        cs6.NullText = ""
        cs6.ReadOnly = True
        cs6.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs6)

        Dim cs7 As DataGridColumnStyle
        cs7 = New DataGridTextBoxColumn  ' Add the standard column style.
        cs7.Width = 100
        cs7.MappingName = "DocFcCode"
        cs7.HeaderText = "FC Code"
        cs7.NullText = ""
        cs7.ReadOnly = True
        cs7.Alignment = HorizontalAlignment.Right
        grdTableStyle.GridColumnStyles.Add(cs7)

        dgTrxEnq.TableStyles.Add(grdTableStyle)

    End Sub

    Private Function GetBBFQty()
        Try
            Dim FrDt, ToDt As String
            FrDt = dtpFromDate.Text
            ToDt = dtpToDate.Text
            FrDt = FrDt.Substring(6, 4) & "-" & FrDt.Substring(3, 2) & "-" & FrDt.Substring(0, 2)
            ToDt = ToDt.Substring(6, 4) & "-" & ToDt.Substring(3, 2) & "-" & ToDt.Substring(0, 2)

            Dim strsql As String
            Dim sqlCon As SqlConnection = New SqlConnection(strCon)
            sqlCon.Open()
            Dim sqlCMD As New SqlCommand(strsql, sqlCon)
            strsql = "Select isnull(Sum(DocAmt),0) Q from APTrx " & _
                     " Where SupID=" & cmbCustomer.SelectedValue & " " & _
                     " and (DocDate < '" & FrDt & "') "
            sqlCMD.CommandText = strsql
            If sqlCon.State = ConnectionState.Closed Then
                sqlCon.Open()
            End If
            BFQty = 0
            Dim rdr As SqlDataReader
            rdr = sqlCMD.ExecuteReader
            If rdr.HasRows Then
                While rdr.Read
                    BFQty = rdr("Q")
                End While
            End If
            rdr.Close()
            sqlCon.Close()
            Dim amt As String = BFQty.ToString()
            If BFQty < 0 Then
                tbOpbal.Text = amt.Replace("-", "") + " Cr"
            Else
                tbOpbal.Text = amt.Replace("-", "") + " Dr"
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Function

    Private Function GetClosingQty()
        Try
            Dim FrDt, ToDt As String
            FrDt = dtpFromDate.Text
            ToDt = dtpToDate.Text
            FrDt = FrDt.Substring(6, 4) & "-" & FrDt.Substring(3, 2) & "-" & FrDt.Substring(0, 2)
            ToDt = ToDt.Substring(6, 4) & "-" & ToDt.Substring(3, 2) & "-" & ToDt.Substring(0, 2)

            Dim strsql As String
            Dim sqlCon As SqlConnection = New SqlConnection(strCon)
            sqlCon.Open()
            Dim sqlCMD As New SqlCommand(strsql, sqlCon)

            strsql = "Select isnull(Sum(DocAmt),0) Q from APTrx " & _
                     " Where SupID=" & cmbCustomer.SelectedValue & " " & _
                     " and (DocDate <= '" & ToDt & "') "
            sqlCMD.CommandText = strsql
            If sqlCon.State = ConnectionState.Closed Then
                sqlCon.Open()
            End If
            Dim rdr As SqlDataReader
            rdr = sqlCMD.ExecuteReader
            Dim CFQty As Double = 0
            If rdr.HasRows Then
                While rdr.Read
                    CFQty = rdr("Q")
                End While
            End If
            rdr.Close()
            sqlCon.Close()
            Dim amt As String = CFQty.ToString()
            If CFQty < 0 Then
                tbClBal.Text = amt.Replace("-", "") + " Cr"
            Else
                tbClBal.Text = amt.Replace("-", "") + " Dr"
            End If
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Function


    Private Sub cmdExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdExit.Click
        Me.Hide()
    End Sub

    Private Sub cmdRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdRefresh.Click
        dgTrxEnq_load()
        GetBBFQty()
        GetClosingQty()
        GetAgedTotals()
    End Sub

    Private Sub cmdPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdPrint.Click
        Me.Cursor = Cursors.WaitCursor
        Dim ds As DataSet = New DataSet("SerpsRpt")
        Dim table As DataTable = New DataTable("SerpsRpt")
        table.Columns.Add("Str1")
        table.Columns.Add("Str2")
        table.Columns.Add("Str3")
        table.Columns.Add("Str4")
        table.Columns.Add("Dec1")
        table.Columns.Add("Dec2")
        table.Columns.Add("Dec3")
        Dim mrow, drow As Integer
        Dim cm As CurrencyManager = BindingContext(dgTrxEnq.DataSource, dgTrxEnq.DataMember)
        Dim dv As DataView = cm.List
        dv.RowStateFilter = DataViewRowState.CurrentRows
        mrow = dv.Count
        'mrow = mrow - drow
        Dim orow As DataRow = table.NewRow()
        orow("Str3") = "OPENING BALANCE:"
        If BFQty >= 0 Then
            orow("Dec1") = BFQty
        Else
            orow("Dec2") = BFQty
        End If
        table.Rows.Add(orow)

        Dim c, d, f As Double
        c = 0.0
        d = 0.0
        f = 0.0


        Dim n As Integer
        For n = 0 To mrow - 1
            Dim nrow As DataRow = table.NewRow()
            nrow("Str1") = Format(CDate(dgTrxEnq.Item(n, 0)), "dd/MM/yyyy")
            nrow("Str2") = dgTrxEnq.Item(n, 1)
            nrow("Str3") = dgTrxEnq.Item(n, 3)
            nrow("Dec1") = dgTrxEnq.Item(n, 4)
            nrow("Dec2") = dgTrxEnq.Item(n, 5)
            nrow("Str4") = dgTrxEnq.Item(n, 7)
            nrow("Dec3") = dgTrxEnq.Item(n, 6)
            If dgTrxEnq.Item(n, 4) Is DBNull.Value Then
            Else
                d += CDbl(dgTrxEnq.Item(n, 4))
            End If
            If dgTrxEnq.Item(n, 5) Is DBNull.Value Then
            Else
                c += CDbl(dgTrxEnq.Item(n, 5))
            End If
            If dgTrxEnq.Item(n, 6) Is DBNull.Value Then
            Else
                f += CDbl(dgTrxEnq.Item(n, 6))
            End If
            table.Rows.Add(nrow)
        Next
        ds.Tables.Add(table)
        Dim APdata As New APdataLogic
        Dim ds4 As DataSet
        ds4 = APdata.GetCompanyAddress(CompanyID)
        Dim PostalAddressE As String = ds4.Tables(0).Rows(0).Item("PostalAddressE").ToString()
        Dim LocationAddressE As String = ds4.Tables(0).Rows(0).Item("LocationAddressE").ToString
        Dim CompanyPhone As String = ds4.Tables(0).Rows(0).Item("Phone").ToString
        Dim CompanyEmail As String = ds4.Tables(0).Rows(0).Item("Email").ToString

        aPstatementRpt1.Load()
        aPstatementRpt1.SetDataSource(ds)
        aPstatementRpt1.SetParameterValue("cr", c.ToString("#0.000"))
        aPstatementRpt1.SetParameterValue("dr", d.ToString("#0.000"))
        aPstatementRpt1.SetParameterValue("fr", f.ToString("#0.000"))
        aPstatementRpt1.SetParameterValue("CompanyName", CompanyTitle)
        aPstatementRpt1.SetParameterValue("ReportTitle", "Statement of Account")
        aPstatementRpt1.SetParameterValue("AccountName", cmbCustomer.Text)
        aPstatementRpt1.SetParameterValue("FromDate", dtpFromDate.Text)
        aPstatementRpt1.SetParameterValue("ToDate", dtpToDate.Text)
        aPstatementRpt1.SetParameterValue("ClosingBalance", tbClBal.Text)
        aPstatementRpt1.SetParameterValue("CurrentAmt", tbAge1.Text)
        aPstatementRpt1.SetParameterValue("Over30Amt", tbAge2.Text)
        aPstatementRpt1.SetParameterValue("Over60Amt", tbAge3.Text)
        aPstatementRpt1.SetParameterValue("Over90Amt", tbAge4.Text)
        aPstatementRpt1.SetParameterValue("AddressLine1", PostalAddressE)
        aPstatementRpt1.SetParameterValue("AddressLine2", LocationAddressE)
        aPstatementRpt1.SetParameterValue("AddressLine3", CompanyPhone)
        aPstatementRpt1.SetParameterValue("AddressLine4", CompanyEmail)

        If PrntPrv Is Nothing Then
            PrntPrv = New PrintPreviewForm
            PrntPrv.CrRptView.ReportSource = aPstatementRpt1
            PrntPrv.ShowDialog()
        End If
        aPstatementRpt1.Close()
        Me.Cursor = Cursors.Default
    End Sub

    Private Sub cbCustomer_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs)
        AutoCompleteCombo_KeyUp(cmbCustomer, e)
        If e.KeyCode = Keys.Enter Then
            SendKeys.Send("{Tab}")
        End If
    End Sub
    Private Sub cbCustomer_Leave(ByVal sender As Object, ByVal e As System.EventArgs)
        AutoCompleteCombo_Leave(cmbCustomer)
    End Sub

    Private Sub cbCustomer_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        If IsNumeric(cmbCustomer.SelectedValue) Then
            Dim APdata As New APdataLogic
            Dim CusCode As String
            CusCode = APdata.GetSupplierCode(cmbCustomer.SelectedValue)
            If CusCode.Trim = "" Then
                MsgBox("Invalid Supplier!", MsgBoxStyle.Critical, "Inventory Manager")
                tbCusCode.Clear()
            Else
                tbCusCode.Text = CusCode
            End If
        End If
    End Sub
    Private Sub tbCusCode_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbCusCode.LostFocus
        If tbCusCode.Text.Trim <> "" Then
            If tbCusCode.Text.Trim <> "" Then
                Dim Apdata As New APdataLogic
                Dim CusID As Integer
                CusID = Apdata.GetSupplierID(tbCusCode.Text)
                If CusID = 0 Then
                    MsgBox("Invalid Supplier Code!", MsgBoxStyle.Critical, "Inventory Manager")
                    tbCusCode.Clear()
                Else
                    cmbCustomer.SelectedValue = CusID
                End If
            End If
        End If
    End Sub
    Private Function GetAgedTotals()
        Try
            Dim CusID As Integer = cmbCustomer.SelectedValue
            Dim FrDt, ToDt As String
            FrDt = dtpFromDate.Text
            ToDt = dtpToDate.Text
            FrDt = FrDt.Substring(6, 4) & "-" & FrDt.Substring(3, 2) & "-" & FrDt.Substring(0, 2)
            ToDt = ToDt.Substring(6, 4) & "-" & ToDt.Substring(3, 2) & "-" & ToDt.Substring(0, 2)

            Dim strsql As String
            Dim sqlCon As SqlConnection = New SqlConnection(strCon)
            sqlCon.Open()
            Dim sqlCMD As New SqlCommand(strsql, sqlCon)
            strsql = "select sum(over90) Over90,sum(over60) Over60,sum(over30) Over30,sum(within30) Within30," & _
                "sum(DrBal) DrBal from " & _
                "(select sum(docamt) over90,0 over60,0 over30,0 within30,0 DrBal " & _
                "from aptrx where(DateDiff(Day, docdate, getdate()) > 90) " & _
                "and docdate<='" & ToDt & "' and SupID=" & CusID & " and DocAmt<0 " & _
                "union all " & _
                "select 0 over90,sum(docamt) over60,0 over30,0 within30,0 DrBal " & _
                "from aptrx where datediff(day,docdate,getdate())<=90 and datediff(day,docdate,getdate())>60 " & _
                "and docdate<='" & ToDt & "' and SupID=" & CusID & " and DocAmt<0 " & _
                "union all " & _
                "select 0 over90,0 over60,sum(docamt) over30,0 within30,0 DrBal " & _
                "from aptrx where datediff(day,docdate,getdate())<=60 and datediff(day,docdate,getdate())>30 " & _
                "and docdate<='" & ToDt & "' and SupID=" & CusID & " and DocAmt<0 " & _
                "union all " & _
                "select 0 over90,0 over60,0 over30,sum(docamt) within30,0 DrBal " & _
                "from aptrx where datediff(day,docdate,getdate())<=30 " & _
                "and docdate<='" & ToDt & "' and SupID=" & CusID & " and DocAmt<0 " & _
                "union all " & _
                "select 0 over90,0 over60,0 over30,0 within30,sum(docamt) DrBal " & _
                "from aptrx where docdate<='" & ToDt & "' and SupID=" & CusID & " and DocAmt>0) x "
            sqlCMD.CommandText = strsql
            If sqlCon.State = ConnectionState.Closed Then
                sqlCon.Open()
            End If
            Dim rdr As SqlDataReader
            rdr = sqlCMD.ExecuteReader
            Dim BFQty As Double = 0
            Dim over90, over60, over30, within30, drbal As Decimal
            If rdr.HasRows Then
                While rdr.Read
                    over90 = rdr("Over90")
                    over60 = rdr("Over60")
                    over30 = rdr("Over30")
                    within30 = rdr("Within30")
                    drbal = rdr("DrBal").ToString().Replace("-", "")
                End While
            End If
            rdr.Close()
            sqlCon.Close()
            If drbal > 0 Then
                If over90 <> 0 Then
                    If over90.ToString().Replace("-", "") >= drbal Then
                        over90 = over90 + drbal
                        drbal = 0
                    Else
                        drbal = over90 + drbal
                        over90 = 0
                    End If
                End If
            End If
            If drbal > 0 Then
                If over60.ToString().Replace("-", "") >= drbal Then
                    over60 = over60 + drbal
                    drbal = 0
                Else
                    drbal = drbal + over60
                    over60 = 0
                End If
            End If
            If drbal > 0 Then
                If over30.ToString().Replace("-", "") >= drbal Then
                    over30 = over30 + drbal
                    drbal = 0
                Else
                    drbal = drbal + over30
                    over30 = 0
                End If
            End If
            If drbal > 0 Then
                If within30.ToString().Replace("-", "") >= drbal Then
                    within30 = within30 + drbal
                    drbal = 0
                Else
                    drbal = drbal + within30
                    within30 = 0
                End If
            End If
            tbAge1.Text = within30.ToString()
            tbAge2.Text = over30.ToString()
            tbAge3.Text = over60.ToString()
            tbAge4.Text = over90.ToString()

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End Function

    Private Sub Label9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label9.Click

    End Sub

    Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label8.Click

    End Sub

    Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click

    End Sub

    Private Sub tbTotalDr_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbTotalDr.TextChanged

    End Sub

    Private Sub tbTotalCr_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbTotalCr.TextChanged

    End Sub

    Private Sub tbClBal_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbClBal.TextChanged

    End Sub

    Private Sub tbOpbal_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbOpbal.TextChanged

    End Sub
End Class
